﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CoyoEden.Web.Controls;
using CoyoEden.Web.Data;
using CoyoEden;
using CoyoEden.Models;

public partial class Pages_Topic : PortalBasePage
{
	public string TopicID { get; set; }
	public string InitPagerStr { get; set; }
	public string CommentListViewPath { get; set; }
	protected void Page_Load(object sender, EventArgs e)
	{
		//TODO:TAGS/COMMENTS
		if (!Page.IsPostBack && !Page.IsCallback) {
			//Init Pager
			InitPagerString();
			//Add js
			Utils.AddJavaScriptInclude(Utils.RelativeWebRoot + "Assets/js/mess/SimplePager.js", Page, true);
			Utils.AddJavaScriptInclude(Utils.RelativeWebRoot + "assets/js/mess/Topic.js", Page, true);
			TopicID=Request["id"];
			var topic = Topic.GetTopic(TopicID);
			TopicComments1.TheTopic = topic;
			CommentListViewPath = ViewBase.GetViewPath(Request, "TopicCommentsView");
		}
	}
	private void InitPagerString()
	{
		SimplePager pager = new SimplePager();
		pager.RowPerPage = 10;
		pager.CurrentPage = 1;
		pager.Tip = "";
		pager.RowTotal = 0;
		pager.PageTotal = 0;

		InitPagerStr = Utils.ToStr<SimplePager>(pager);
	}
}
